<?php
/**
 * Created by PhpStorm.
 * User: iceberg
 * Date: 2018-10-09
 * Time: 16:10
 */

namespace app\validate;


use think\Validate;

class ProductValidate extends Validate
{
    protected $rule = [
        'name'      =>  'require|max:25',
        'desc'      =>  'max:100',
        'category'  =>  'require',
        'unit'      =>  'require',
    ];

    protected $message  =   [
        'name.require'      =>  '名称必填',
        'name.max'          =>  '名称最多不能超过25个字符',
        'desc.max'          =>  '备注最多不能超过100个字符',
        'category.require'  =>  '类别必填',
        'unit.require'      =>  '单位必填',
    ];
}